﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;

namespace Campus {
    class SchoolCafeteria : Structure {
        static public Texture2D BuildingTexture { get; private set; }
        static public Texture2D StaticTeamColorTexture { get; private set; }
        static public Texture2D ConstructionTexture { get; private set; }
        static public Vector2 StaticOrigin { get; private set; }
        static public List<Vector2> StaticTilesOccupied { get; private set; }
        static public void InitializeTextures(ContentManager Content) {
            BuildingTexture = Content.Load<Texture2D>("Structures/building_cafeteria_base");
            StaticTeamColorTexture = Content.Load<Texture2D>("Structures/building_cafeteria_team");
            ConstructionTexture = Content.Load<Texture2D>("Structures/building_cafeteria_build");
            StaticOrigin = new Vector2(8, 119);

            StaticTilesOccupied = new List<Vector2>();
            StaticTilesOccupied.Add(new Vector2(0, 0));  // Tile this building is placed on.
            StaticTilesOccupied.Add(new Vector2(0, 1));
            StaticTilesOccupied.Add(new Vector2(0, 2));
            StaticTilesOccupied.Add(new Vector2(1, 0));
            StaticTilesOccupied.Add(new Vector2(1, 1));
            StaticTilesOccupied.Add(new Vector2(1, 2));
            StaticTilesOccupied.Add(new Vector2(2, 0));
            StaticTilesOccupied.Add(new Vector2(2, 1));
            StaticTilesOccupied.Add(new Vector2(2, 2));
        }

        public SchoolCafeteria(Player owner, Level level)
            : base(BuildingTexture, StaticTeamColorTexture, ConstructionTexture, StaticTilesOccupied, StaticOrigin, Vector2.Zero, 100, owner, level, new Dictionary<string, Ability>(), new Dictionary<string, AbilitySubMenu>()) {
            m_name = "School Cafeteria";
            owner.AddMaxFood(5);
            CanAttack = false;
        }
        protected override void Destroy() {
            PlayerOwner.AddMaxFood(-5);
            base.Destroy();
        }

        public override string ToString() {
            string returnString = m_name + "\n" +
                                  "HP: " + m_currentHP + "/" + m_maxHP + "\n" + 
                                  "The School Cafeteria provides 5 food for creating more units.";
            return returnString;
        }
        public override void Update(GameTime gameTime, bool checkInput, bool updateBoundingBox) {
            base.Update(gameTime, checkInput, updateBoundingBox);
        }
        public override void Update(Player Player) {
        }
    }
}
